package com.shouyun.modules.sys.controller;

import com.alibaba.fastjson.JSONObject;
import com.shouyun.common.utils.DataUtils;
import com.shouyun.common.utils.Result;
import org.springframework.web.bind.annotation.*;


/**
 * 系统参数管理
 *
 * @author Sunshouguo
 */
@RestController
@RequestMapping("/sys/params")
public class SysParamsController {

    @GetMapping("info")
    public Result info() {
        return new Result().ok(DataUtils.getData(DataUtils.PARAMS, "sys"));
    }

    @PostMapping
    public Result save(@RequestBody JSONObject params) {
        DataUtils.setData(DataUtils.PARAMS, "sys", params);
        return new Result();
    }
}